<script setup lang="ts">
const props = defineProps(['hospital'])
import { useRouter } from 'vue-router'
const router = useRouter()
const gotoDetail = () => {
  router.push({
    name: 'Detail',
    query: {
      code: props.hospital.hoscode,
    },
  })
}
</script>

<template>
  <el-card shadow="hover" @click="gotoDetail">
    <div class="hospital_item">
      <div class="hospital_item_info">
        <div class="hospital_item_title">
          <h3>{{ hospital.title }}</h3>
        </div>
        <div class="hospital_item_address">
          <div>
            <svg-icon name="dianzan" />
            <p>{{ hospital.hospType }}</p>
          </div>
          <div>
            <svg-icon name="shijian-xianxing" />
            <p>{{ hospital.releaseTime }} - {{ hospital.quitTime }}</p>
          </div>
        </div>
      </div>
      <div class="hospital_item_img">
        <img :src="`data:image/jpeg;base64,${hospital.picUrl}`" alt="医院图片" />
      </div>
    </div>
  </el-card>
</template>

<style lang="scss" scoped>
.hospital_item {
  display: flex;
  justify-content: space-between;
  .hospital_item_info {
    width: 60%;
    .hospital_item_title {
      h3 {
        font-weight: bold;
      }
    }
    .hospital_item_address {
      margin-top: 10px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      div {
        display: flex;
        align-items: center;
        p {
          margin-left: 5px;
          font-size: 14px;
          color: #7f7f7f;
        }
      }
    }
  }
  .hospital_item_img {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 90px;
    img {
      width: 100%;
      height: 100%;
      border-radius: 90px;
    }
  }
}
</style>
